// 模拟后端动态生成路由
import { MockMethod } from "vite-plugin-mock";
// 大屏路由
// const screenRoutes = {
//   id: "1",
//   name: "大屏",
//   code: "portal",
//   children: [
//     {
//       id: "1-1",
//       name: "首页",
//       type: "1",
//       url: "/home/index",
//       code: "home",
//       icon: "",
//       isHidden: false,
//       sort: 1
//     }
//   ]
// };
// 后台管理路由
const manageRoutes = {
  id: "2",
  name: "后台管理",
  code: "manage",
  children: [
    {
      id: "2-1",
      name: "后台首页",
      type: "1",
      url: "/dashboard/index",
      code: "dashboard",
      icon: "iconfont icon-home-fill",
      isHidden: false,
      sort: 1
    },
    {
      id: "2-2",
      name: "系统管理",
      type: "1",
      url: "/settings",
      code: "settings",
      icon: "Tools",
      isHidden: false,
      sort: 2,
      children: [
        {
          id: "2-2-1",
          name: "用户管理",
          type: "2",
          url: "/settings/user",
          code: "systemUser",
          icon: "",
          isHidden: false,
          sort: 1
        },
        {
          id: "2-2-2",
          name: "角色管理",
          type: "2",
          url: "/settings/role",
          code: "systemRole",
          icon: "",
          isHidden: false,
          sort: 2
        },
        {
          id: "2-2-3",
          name: "菜单管理",
          type: "2",
          url: "/settings/menu",
          code: "settingsMenu",
          icon: "",
          isHidden: false,
          sort: 3
        }
      ]
    }
  ]
};
export default [
  {
    url: "/getAsyncRoutes",
    method: "post",
    response: () => {
      return {
        status: 200,
        statusText: "OK",
        data: {
          msg: "success",
          code: 200,
          data: [
            // screenRoutes, // 大屏路由
            manageRoutes // 后台管理路由
          ],
          object: null,
          timestamp: 1626507200000
        }
      };
    }
  }
] as MockMethod[];
